import socket
c = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

while 1:
    mag = input('input>>>').strip()
    c.sendto(mag.encode(), ('localhost', 9000))
    data, addr = c.recvfrom(1024)
    print(f'收到回复：{data.decode()} ,来自：[{addr}]')